import React, {Component} from "react";

export default class Life extends Component {
    constructor() {
        super()
        console.log("钩子函数：constructor");
        let h1 = document.getElementById('h1')
        console.log(h1);
        // console.log(h1..innerHTML);
    }

    render() {
        console.log("render");
        let h1 = document.getElementById('h1')
        console.log(h1);
        // console.log(h1..innerHTML);
        return (
            <div>
                <h1 id="h1">life cycle</h1>
            </div>
        )
    }

    componentDidMount() {
        console.log("componentDidMount");
        let h1 = document.getElementById('h1')
        console.log(h1);
        // console.log(h1..innerHTML);
    }
}